<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.general.Util" %>
<%
    JSONObject jsonData = new JSONObject();
    String yclx = Util.null2String( request.getParameter( "yclx" ) );
    String ycrq = Util.null2String( request.getParameter( "ycrq" ) );
    String requestid = Util.null2String( request.getParameter( "requestid" ) );
    boolean flag = false;
    rs.executeQuery( "select count(id) counts,sum(abj) as abj,sum(b1bj) as b1bj," +
            "sum(b2bj) as b2bj,sum(cbj) as cbj,sum(dbj) as dbj,sum(ebj) as ebj\n" +
            "from view_ycgl where yclx=? and ycrq=? and requestid !=?", yclx, ycrq,requestid);
    rs.next();
    int counts = Util.getIntValue( rs.getString( "counts" ),-1 );
    if (counts>0) {
        String abj = Util.null2String( rs.getString( "abj" ) );
        String b1bj = Util.null2String( rs.getString( "b1bj" ) );
        String b2bj = Util.null2String( rs.getString( "b2bj" ) );
        String cbj = Util.null2String( rs.getString( "cbj" ) );
        String dbj = Util.null2String( rs.getString( "dbj" ) );
        String ebj = Util.null2String( rs.getString( "ebj" ) );
        jsonData.put( "abj", abj );
        jsonData.put( "b1bj", b1bj );
        jsonData.put( "b2bj", b2bj );
        jsonData.put( "cbj", cbj );
        jsonData.put( "dbj", dbj );
        jsonData.put( "ebj", ebj );
        flag = true;
    }
    jsonData.put( "flag", flag );
    out.print( jsonData.toJSONString() );
    bb.writeLog( "getRoomNumber_Ajax.jsp=" + jsonData.toJSONString() );
%>
